<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<div fxLayout="row" fxLayoutAlign="start center">
    <mat-checkbox
        color="accent"
        [(ngModel)]="field.selected"
        (change)="triggerConfigurationUpdate()"
    >
        {{ field.runtimeName }}
    </mat-checkbox>
    <div fxFlex fxLayoutAlign="end center">
        <mat-form-field
            appearance="outline"
            color="accent"
            class="aggregation-width small-form"
            floatLabel="never"
            *ngIf="!(sourceConfig.queryType === 'raw')"
        >
            <mat-select
                disableRipple
                [(ngModel)]="field.aggregations"
                multiple
                [panelClass]="'form-field-small-min-width'"
                (ngModelChange)="triggerConfigurationUpdate()"
            >
                <mat-option [value]="'MEAN'" *ngIf="field.numeric">
                    <span class="pipeline-name">Mean</span>
                </mat-option>
                <mat-option [value]="'FIRST'">
                    <span class="pipeline-name">First</span>
                </mat-option>
                <mat-option [value]="'LAST'">
                    <span class="pipeline-name">Last</span>
                </mat-option>
                <mat-option [value]="'MIN'" *ngIf="field.numeric">
                    <span class="pipeline-name">Min</span>
                </mat-option>
                <mat-option [value]="'MAX'" *ngIf="field.numeric">
                    <span class="pipeline-name">Max</span>
                </mat-option>
                <mat-option [value]="'MODE'">
                    <span class="pipeline-name">Mode</span>
                </mat-option>
                <mat-option [value]="'COUNT'">
                    <span class="pipeline-name">Count</span>
                </mat-option>
                <mat-option [value]="'SUM'">
                    <span class="pipeline-name">Sum</span>
                </mat-option>
            </mat-select>
        </mat-form-field>
    </div>
</div>
